package com.qf.service.impl;

import com.qf.dao.CartDao;
import com.qf.dao.impl.CartDaoImpl;
import com.qf.entity.Cart;
import com.qf.service.CartService;

import java.util.List;

/**
 * @author 10202
 * @version V1.0
 * @Project xiaomi
 * @Package com.qf.service.impl
 * @Date 2023/4/14 15:38
 */
public class CartServiceImpl implements CartService {
    private static CartDao cartDao=new CartDaoImpl();
    @Override
    public Cart query(Integer uid, int gid) {
        return cartDao.query(uid,gid);
    }

    @Override
    public void insertCart(Cart newCart) {
        cartDao.createCart(newCart);
    }

    @Override
    public void updateCart(Cart cart) {
        cartDao.updateCart(cart);
    }

    @Override
    public List<Cart> queryCartByname(Integer uid) {


        return cartDao.queryByUid(uid);
    }

    @Override
    public void deleteCartByUidGid(Integer uid, int gid) {

        cartDao.deleteCart(uid,gid);
    }

    @Override
    public void deleteCartByUid(Integer id) {
        cartDao.deleteCart(id);
    }
}
